import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
// const Home = () => import('../views/home/Home')
// const Category = () => import('../views/category/Category')
// const Cart = () => import('../views/cart/Cart')
// const Profile = () => import('../views/profile/Profile')
const Order_main = () => import('views/mymain/order/Order_main')
const User_main = () => import('views/mymain/user/User_main')
const Staff_main = () => import('views/mymain/staff/Staff_main')
const Info_main = () => import('views/mymain/info/Info_main')
const Empower_main=()=>import('views/mymain/empower/Empower_main')
const blank_emt=()=>import('views/blank/blank.vue')
const routes = [{
		path: '',
		redirect: '/Order_main',
	},
	{
		path: '/Order_main',
		component: Order_main,
		meta:{
			requireAuth:true
		}
	},
	{
		path: '/User_main',
		component: User_main
	},
	{
		path: '/Staff_main',
		component: Staff_main
	},
	{
		path: '/Info_main',
		component: Info_main
	},
	{
		path: '/Empower_main',
		component: Empower_main
	},
	{
		path: '/blank_emt',
		component: blank_emt
	}
	
]

const router = new VueRouter({
	// mode: 'history',
	routes

})
	router.beforeEach((to,from,next)=>{
		if(to.meta.requireAuth){
			//console.log("请登录");
			next();
		}else{
			next();
		}
	})
export default router
